package com.chatgpt.platformbasedchatgpt.utils;

import java.util.Random;

public class CheckCode {
    public static String getCode() {
        long currentTimeMillis = System.currentTimeMillis();
        Random random = new Random(currentTimeMillis);

        String verificationCode = "";
        for (int i = 0; i < 6; i++) {
            int digit = random.nextInt(10); // 生成一个0到9之间的随机数字
            verificationCode += digit; // 将随机数字添加到验证码字符串中
        }
        return verificationCode;
    }
}
